<?php

/**
 * This file contains functions specific to 
 * Sand Dollar - Such as Manufacturer Cleanup
 *
 * @author     Bert Pereira <bspereira@etilize.com>
 * @date       17th March, 2012
 * @version    1.0
 */

function cleanup_manufacturer($string){
    $replacements = array(
                    'Corporation'=>'',
                    ', Inc'=>'',
                    'Inc'=>'',
                    'Corp'=>'',
                    'Ltd'=>'',
                    'International'=>'',
                    ', Ltd'=>'',
                    'LLC'=>'',
                    ', LLC'=>'',
                    'Holdings'=>'',
                    ', Corp'=>'',
                    'Technology'=>'',
                    'Company'=>'',
                    'Technologies'=>'',
                    'Group Limited'=>'',
                    'Limited'=>'',
                    'Solutions'=>'',
                    'Systems'=>'',
                    'Co.'=>'',
                    'Display'=>'',
                    'Products'=>'',
                    'Electronics'=>'',
                    "ACP - Memory Upgrades"=>"ACP",
                    "AddOn - Memory Upgrades"=>"Addon",
                    "AddOn - Network Upgrade"=>"Addon",
                    "Alesis orate Headquarters"=>"Alesis",
                    "ASUS Computer"=>"ASUS",
                    "Atdec Pty"=>"Atdec",
                    "Audio-Technica U.S."=>"Audio-Technica",
                    "AVer Information"=>"AVer",
                    "Avery Dennison"=>"Avery",
                    "Axis Communications"=>"Axis",
                    "Azend Group"=>"Azend",
                    "BES Manufacturing"=>"BES",
                    "BIC America"=>"BIC",
                    "Bixolon America"=>"Bixolon",
                    "Blue Star Communications"=>"Blue Star",
                    "Blueant Wireless Pty"=>"Blueant",
                    "Bogen Communications"=>"Bogen",
                    "Bretford Manufacturing"=>"Bretford",
                    "Buffalo (USA)"=>"Buffalo",
                    "Buslink Media"=>"Buslink",
                    "CAD Professional Microphones"=>"CAD",
                    "Canary Communications"=>"Canary",
                    "Chelsio Communications"=>"Chelsio",
                    "Chief Manufacturing"=>"Chief MFG",
                    "ClearOne Communications"=>"ClearOne",
                    "Clover U.S.A"=>"Clover",
                    "Cocoon Innovations"=>"Cocoon",
                    "Corsair Memory"=>"Corsair",
                    "CRU Acquisitions Group"=>"CRU",
                    "Datacomm Cables"=>"Datacomm",
                    "Dantona Industries"=>"Dantona",
                    "Dane-Elec Memory"=>"Dane-Elec",
                    "Datalogic S.p.A"=>"Datalogic",
                    "Diamond Multimedia, USA"=>"Diamond",
                    "DigiStore  (S) Pte."=>"DigiStore",
                    "Digital Data Communications GmbH"=>"Digital Data",
                    "DoubleSight s"=>"DoubleSight",
                    "DPI, In"=>"DPI",
                    "Eastman Kodak"=>"Kodak",
                    "Elexa Consumer"=>"Elexa",
                    "EMD group"=>"EMD",
                    "Emerson Network Power"=>"Emerson",
                    "eNet Components."=>"eNet",
                    "Fluke Networks"=>"Fluke",
                    "Fuji Photo Film"=>"Fujifilm",
                    "GN Netcom A/S"=>"GN Netcom",
                    "Grandtec USA"=>"Grandtec",
                    "Guillemot  B.P."=>"Guillemot",
                    "Hamilton Beach Brands"=>"Hamilton Beach",
                    "Hauppauge Computer Works"=>"Hauppauge",
                    "Hitachi Global Storage"=>"Hitachi",
                    "Hoffco Brands"=>"Hoffco",
                    "Hewlett-Packard"=>"HP",
                    "HP-IMSourcing"=>"HP",
                    "IBM-IMSourcing"=>"IBM",
                    "IDEAL Industries"=>"IDEAL",
                    "IMC Networks ."=>"IMC",
                    "Intel-IMSourcing"=>"Intel",
                    "Intellinet Network"=>"Intellinet",
                    "Jewell Instruments"=>"Jewell",
                    "Juniper Networks"=>"Juniper",
                    "KBC Networks"=>"KBC",
                    "Kenneth Cole Productions"=>"Kenneth Cole",
                    "Kensington Computer  Group"=>"Kensington",
                    "KeyTronicEMS orate"=>"KeyTronic",
                    "LG-Ericsson USA"=>"LG-Ericsson",
                    "M-Edge Accessories"=>"M-Edge",
                    "North American Battery"=>"NABC",
                    "Nuance Communications"=>"Nuance",
                    "Numark Industries"=>"Numark",
                    "Oki Electric Industry"=>"Oki Electric",
                    "Palo Alto Audio Design"=>"Palo Alto Audio",
                    "Partner Tech USA"=>"Partner Tech",
                    "Paxton Access ."=>"Paxton",
                    "Peerless Industries"=>"Peerless",
                    "PENTAX Imaging"=>"PENTAX",
                    "Pioneer POS"=>"Pioneer",
                    "Premiertek.net"=>"Premiertek",
                    "Raritan Computer"=>"Raritan",
                    "Razer USA"=>"Razer",
                    "Research In Motion"=>"RIM",
                    "Revo America"=>"Revo",
                    "ROTA America"=>"ROTA",
                    "Sanford, L.P."=>"Sanford",
                    "Sangean America"=>"Sangean",
                    "Scan Wireless Partners"=>"Scan Wireless",
                    "Scosche Industries"=>"Scosche",
                    "Seiko Instruments USA"=>"Seiko",
                    "Sherwood America"=>"Sherwood",
                    "Silex  America"=>"Silex",
                    "Solarflare Communications"=>"Solarflare",
                    "StarTech.com"=>"StarTech",
                    "STI Certified"=>"STI",
                    "Superior Value Added"=>"SVAT",
                    "Supermicro Computer"=>"Supermicro",
                    "SYBA Multimedia"=>"SYBA",
                    "Tallygenicom, L.P"=>"Tallygenicom",
                    "Targus Group"=>"Targus",
                    "The Chamberlain Group"=>"Chamberlain",
                    "Teac America"=>"Teac",
                    "Tocad America"=>"ToCAD",
                    "Transcend Information"=>"Transcend",
                    "Transition Networks"=>"Transition",
                    "Uniform Industrial"=>"Uniform",
                    "Vanguard(USA)"=>"Vanguard",
                    "Verbatim America"=>"Verbatim",
                    "Victor  of Japan"=>"JVC",
                    "Victorinox AG"=>"Victorinox",
                    "Voyetra Turtle Beach"=>"Turtle Beach",
                    "Wacom Co"=>"Wacom",
                    "Wasp Barcode"=>"Wasp",
                    "WC Distributors"=>"WorldCharge",
                    "Wine Enthusiast Companies"=>"Wine Enthusiast",
                    "Women in Business"=>"WIB",
                    "Zoom Switch"=>"ZoomSwitch",
                    "Zoom Telephonics"=>"Zoom",
                    "Zyxel Communications ."=>"Zyxel",
                    "Advanced Video Communications"=>"AVC",
                    "Citizen Micro HumanTech"=>"Citizen Micro",
                    "American Power Conversion"=>"APC",
                    "AT&T"=>'ATT'
    );
    $cleanString = preg_replace('/\s\s+/',' ',$string);
    $cleanString = str_replace(array_keys($replacements), array_values($replacements), $string);
    $cleanString = trim($cleanString);
    $cleanString = trim($cleanString,',');
    return $cleanString;
}
?>
